package com.zz.ecommerce.goodPreClassify;

import com.zz.ecommerce.common.GridRequest;
import com.zz.ecommerce.common.GridResult;
import com.zz.ecommerce.searchManage.goods.preclassified.HsCodeService;
import com.zz.ecommerce.searchManage.goods.preclassified.SComplex;
import com.zz.ecommerce.searchManage.goods.preclassified.STraiff;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * Created by admin on 2016/4/6.
 */
@Controller
@RequestMapping("/goodPreClassify/search")
@Scope("prototype")
public class GoodPreClassifyController {

    @Autowired
    private HsCodeService hsCodeService;

    /**
     * 商品预归类查询
     *
     * @return
     */
    @RequestMapping(value = "indx", method = {RequestMethod.GET, RequestMethod.POST})
    public String myPlatform() {
        return "/goodPreClassify/search/indx";
    }


    /**
     * 查询HS编码信息
     *
     * @param sComplex
     * @param request
     * @return
     */
    @RequestMapping("/queryHsCodeList")
    @ResponseBody
    public GridResult queryHsCodeList(SComplex sComplex, GridRequest request) {
        return hsCodeService.queryPreHsCodeList(request, sComplex);
    }

    /**
     * 查询出口税则信息
     *
     * @param sComplex
     * @param request
     * @return
     */
    @RequestMapping("/queryTariffInfoList")
    @ResponseBody
    public GridResult queryTariffInfoList(STraiff sComplex, GridRequest request) {
        return hsCodeService.queryTariffInfoList(request, sComplex);
    }

    /**
     * 查询出口税则信息
     *
     * @param hsCode
     * @return
     */
    @RequestMapping("/queryMapTariffInfoList")
    @ResponseBody
    public List<Map> queryMapTariffInfoList(String hsCode) {
        return hsCodeService.queryMapTariffInfoList(hsCode);
    }
}
